home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
57
< prev
next >
Wrap
Text File
|
1996-08-06
|
843b
|
32 lines
Path: funcom.no!news
From: eivind@odin.funcom.com (Eivind Eklund)
Newsgroups: comp.std.c
Subject: int's and zero
Date: 9 Jan 1996 10:47:42 GMT
Organization: Funcom Productions.
Message-ID: <4cth4e$4q@odin.funcom.no>
NNTP-Posting-Host: odin.funcom.no
X-Newsreader: knews 0.9.3
Are zero in an integer required to be represented by binary zeros?
I know it is not required for floats and pointers, so memset()ing a
structure to 8-bit zeros are not correct if it contain pointers or
floating point values, but what about integers? Ie, if I have
struct intstruct {
int a;
long b;
short c;
};
..
struct intstruct teststruct;
memset(&teststruct, 0, sizeof(teststruct));
Is teststruct.a, teststruct.b, and teststruct.c guaranteed to be == 0?
--
Eivind Eklund
eivind.eklund@funcom.com
FUNCOM don't speak for me, and I return the courtesy.